import '../presenter/home_presenter.dart';
import '../repository/novel_repository.dart';
import '../usecase/novel_usecase.dart';
import 'usecase.dart';

class HomeInitUseCase extends UseCase<Future<void>, NoParams> {
  final HomePresenter _presenter;
  final NovelRepository _novelRepository;

  HomeInitUseCase(this._presenter, this._novelRepository);
  @override
  Future<void> call(NoParams params) async {
    await _getBookShelfNovelList();
    await _getReadHistoryNovelList();
  }

  Future<void> _getReadHistoryNovelList() =>
      HomeGetReadHistory(_presenter, _novelRepository)(NoParams());

  Future<void> _getBookShelfNovelList() =>
      HomeGetBookShelf(_presenter, _novelRepository)(NoParams());
}
